<%--
  Created by IntelliJ IDEA.
  User: MECHREVO
  Date: 2021/4/13
  Time: 8:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<link href="${pageContext.request.contextPath}/ui/layui/css/layui.css" rel="stylesheet"/>
<script src="${pageContext.request.contextPath}/ui/layui/layui.js"></script>

<style>
    .layui-col-xs9 layui-col-md3{
        font-size: 20px;
    }
    #da{
        height: 100%;
        width: 100%;
        /*background-color: #F9FAFD;*/
        background-color: #F1F3F4;
    }
    .type{
        width: 1200px;
        height: 800px;
        background-color: #FFFFFF;
        margin-left: 598px;
        margin-top: 16px;
    }
    .name{
        width: 245px;
        height: 50px;
        /*background-color: #eb7350;*/
    }
    .sou{
        width: 589px;
        height: 60px;
        /*background-color: #eb7350;*/
        margin-top: 12px;
    }
    .ann{
        width: 550px;
        height: 66px;
        /*background-color: #eb7350;*/
        margin-top: 12px;
        float: left;
    }
    .zhansh{
        width: 1065px;
        height: 500px;
        /*background-color: #eb7350;*/
        margin-top: 100px;
    }

</style>
<body>
<div id="da">
    <div class="box">
        <ul class="layui-nav">
            <li class="layui-nav-item"><a href="">首页</a></li>

            <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/demandhall">需求大厅</a></li>
            <li class="layui-nav-item" style="margin-left: 1532px;">
                <a href="javascript:;">${userinfo.userName}</a>
                <dl class="layui-nav-child">
                    <dd><a href="${pageContext.request.contextPath}/updatedanInfo">基本信息</a></dd>
                    <dd><a href="${pageContext.request.contextPath}/anquan">安全管理</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/WEB-INF/jsp/login.jsp">退出</a></li>
        </ul>
    </div>
    <div class="layui-col-xs9 layui-col-md3">
        <div class="layui-panel">
            <ul class="layui-menu" id="docDemoMenu1">
                <li lay-options="{id: 100}">
                    <div class="layui-menu-body-title">我&nbsp&nbsp的&nbsp&nbsp工&nbsp&nbsp作&nbsp&nbsp台</div>
                </li>

                <li class="layui-menu-item-divider"></li>
                <li class="layui-menu-item-group layui-menu-item-down" lay-options="{type: 'group', isAllowSpread: false}">
                    <div class="layui-menu-body-title">
                        我&nbsp&nbsp的&nbsp&nbsp需&nbsp&nbsp求
                    </div>
                    <ul>
                        <li lay-options="{id: 1031}"><div class="layui-menu-body-title">我发布的需求</div></li>
                        <li lay-options="{id: 1032}">
                            <div class="layui-menu-body-title">我的草稿箱</div>
                        </li>
                        <li lay-options="{id: 1032}">
                            <div class="layui-menu-body-title">我竞标的项目</div>
                        </li>
                    </ul>
                </li>
                <li class="layui-menu-item-divider"></li>
                <li class="layui-menu-item-group layui-menu-item-down" lay-options="{type: 'group', isAllowSpread: false}">
                    <div class="layui-menu-body-title">项&nbsp&nbsp目&nbsp&nbsp类&nbsp&nbsp型&nbsp&nbsp管&nbsp&nbsp理</div>
                    <ul>
                        <a href="${pageContext.request.contextPath}/demandtype"><li lay-options="{id: 1031}"><div class="layui-menu-body-title">项目类型列表</div></li></a>

                    </ul>
                </li>
                <li class="layui-menu-item-divider"></li>

                <li class="layui-menu-item-group layui-menu-item-down" lay-options="{type: 'group', isAllowSpread: false}">
                    <div class="layui-menu-body-title">技&nbsp&nbsp能&nbsp&nbsp标&nbsp&nbsp签&nbsp&nbsp管&nbsp&nbsp理</div>
                    <ul>
                        <li lay-options="{id: 1031}"><div class="layui-menu-body-title">技能标签管理</div></li>

                    </ul>
                </li>

            </ul>
        </div>
    </div>

    <div class="type">
        <div class="name">
            <span style="font-size: 28px;font-weight:bold;">项目类型列表</span>
        </div>
        <div class="sou">

           <input type="text" name="prohectTypeName" value="" id="prohectTypeName" autocomplete="off" placeholder="搜索项目类型名称" class="layui-input" style="height: 50px;">

            <input type="hidden" value="${pageContext.request.contextPath}" id="contextPath">
            <input type="button" class="layui-btn" id="withExport" value="查询项目" style="margin-top: -49px;margin-left: 495px;height: 49px;">

        </div>
        <div class="ann">
            <%--<button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">添加</button>--%>
            <input type="button" class="layui-btn layui-btn-normal" id="withExportyj" value="添加" >
            <input type="button" class="layui-btn layui-btn-normal" id="withExportxg" value="修改" >
            <button type="button" class="layui-btn">删除</button>
        </div>
        <div class="zhansh">
            <table border="2px" style="text-align: center;" id="table1">
                <tr>
                    <td></td>
                    <td width="50px">序号</td>
                    <td width="80px">项目类型名称</td>
                    <td width="80px">创建时间</td>
                    <td width="80px">修改时间</td>
                    <td width="80px">操作</td>
                </tr>
                <c:forEach items="${projectTypes}" var="projectTypes">
                    <tr >
                        <td></td>
                        <td>${projectTypes.pkId}</td>
                        <td>${projectTypes.prohectTypeName}</td>
                        <td>${projectTypes.createTime}</td>
                        <td>${projectTypes.updateTime}</td>
                        <td>
                            <input type="button" class="layui-btn layui-btn-normal" id="withExportxg1" value="修改" >
                            <a href="${pageContext.request.contextPath}/projecttypedelete?projectTypeId=${projectTypes.projectTypeId}"><button type="button" class="layui-btn">删除</button></a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <div style="width: 552px;height: 300px;margin-top: -116px;margin-left: 670px; position: absolute;" id="tk" >
        <div style="display: none;width: 552px;height: 300px;background-color: #eb7350;margin-top: -463px;margin-left: 7px; position: absolute;" >
            <div style="margin-top: 90px; ">
                <input type="text" name="prohectTypeName" value="" id="projectTypeadd" autocomplete="off" placeholder="添加项目类型名称" class="layui-input" style="height: 50px;">
            </div>

            <input type="button" class="layui-btn" id="withExportadd" value="添加类型" style="height: 49px; margin-top: 18px;margin-left: 206px">
        </div>
    </div>


    <div style="width: 552px;height: 300px;margin-top: -116px;margin-left: 670px; position: absolute;" id="tk1" >
        <div style="display: none;width: 552px;height: 300px;background-color: #eb7350;margin-top: -463px;margin-left: 7px; position: absolute;" >
            <div style="margin-top: 90px; ">
                <input type="text" name="prohectTypeName" value="" id="projectTypeupdate" autocomplete="off" placeholder="修改项目类型名称" class="layui-input" style="height: 50px;">
            </div>

            <input type="button" class="layui-btn" id="withExportupdate" value="修改类型" style="height: 49px; margin-top: 18px;margin-left: 206px">
        </div>
    </div>
</div>

</body>
<script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
<script type="text/javascript">
    layui.use('form',function () {
        var form = layui.form;
        $("#withExport").click(function () {
            layer.msg("弹框");
            /*alert($(this).val())*/
            alert("点击")
            var prohectTypeName = $("#prohectTypeName").val();
            alert(prohectTypeName);
            var url = $("#contextPath").val() + "/projecttypelike";

            $.ajax({
                type: "post",
                url: url,
                data:JSON.stringify({
                    "prohectTypeName":prohectTypeName
                }),
                dataType: "json",
                async: true,
                contentType: "application/json;charset=utf-8",
                success: function (data) {
                    var element = "<tr>\n" +
                        "                    <td></td>\n" +
                        "                    <td width=\"50px\">序号</td>\n" +
                        "                    <td width=\"80px\">项目类型名称</td>\n" +
                        "                    <td width=\"80px\">创建时间</td>\n" +
                        "                    <td width=\"80px\">修改时间</td>\n" +
                        "                    <td width=\"80px\">操作</td>\n" +
                        "                </tr>";
                    for (var i = 0; i < data.length; i++) {
                        element += "<tr >\n" +
                            "                        <td></td>\n" +
                            "                        <td>"+i+"</td>\n" +
                            "                        <td>"+data[i].prohectTypeName+"</td>\n" +
                            "                        <td>"+data[i].createTime+"</td>\n" +
                            "                        <td>"+data[i].updateTime+"</td>\n" +
                            "                        <td>\n" +
                            "                            <button type=\"button\" class=\"layui-btn\">修改</button>\n" +
                            "                             <a href=\"${pageContext.request.contextPath}/projecttypedelete?projectTypeId="+data[i].projectTypeId+"\"><button type=\"button\" class=\"layui-btn\">删除</button></a>\n" +
                            "                        </td>\n" +
                            "                    </tr>"
                    }

                    $("#table1").html(element);
                    /*$("#homecities").html(element);*/
                    form.render('select');
                },

            });
            console.log("success")

        });


    })



    layui.use('form',function () {
        var form = layui.form;
        $("#withExportyj").click(function () {
            layer.msg("弹框");
            var element="<div style=\"width: 552px;height: 300px;background-color: #eb7350;margin-top: -463px;margin-left: 7px; position: absolute;\" >\n" +
                "            <div style=\"margin-top: 90px; \">\n" +
                "                <input type=\"text\" name=\"prohectTypeName\" value=\"\" id=\"projectTypeadd\" autocomplete=\"off\" placeholder=\"添加项目类型名称\" class=\"layui-input\" style=\"height: 50px;\">\n" +
                "            </div>\n" +
                "\n" +
                "            <input type=\"button\" class=\"layui-btn\" id=\"withExportadd\" value=\"添加类型\" style=\"height: 49px; margin-top: 18px;margin-left: 206px\">\n" +
                "        </div>";

            $("#tk").html(element);

            console.log("success")

        });

    })

    layui.use('form',function () {
        var form = layui.form;
        $("#withExportxg").click(function () {
            layer.msg("弹框");
            var element="<div style=\"/*display: none;*/width: 552px;height: 300px;background-color: #eb7350;margin-top: -463px;margin-left: 7px; position: absolute;\" >\n" +
                "            <div style=\"margin-top: 90px; \">\n" +
                "                <input type=\"text\" name=\"prohectTypeName\" value=\"\" id=\"projectTypeadd\" autocomplete=\"off\" placeholder=\"修改项目类型名称\" class=\"layui-input\" style=\"height: 50px;\">\n" +
                "            </div>\n" +
                "\n" +
                "            <input type=\"button\" class=\"layui-btn\" id=\"withExportupdate\" value=\"修改类型\" style=\"height: 49px; margin-top: 18px;margin-left: 206px\">\n" +
                "        </div>";

            $("#tk1").html(element);

            console.log("success")

        });

    })
    layui.use('form',function () {
        var form = layui.form;
        $("#withExportxg1").click(function () {
            layer.msg("弹框");
            var element="<div style=\"/*display: none;*/width: 552px;height: 300px;background-color: #eb7350;margin-top: -463px;margin-left: 7px; position: absolute;\" >\n" +
                "            <div style=\"margin-top: 90px; \">\n" +
                "                <input type=\"text\" name=\"prohectTypeName\" value=\"\" id=\"projectTypeadd\" autocomplete=\"off\" placeholder=\"修改项目类型名称\" class=\"layui-input\" style=\"height: 50px;\">\n" +
                "            </div>\n" +
                "\n" +
                "            <input type=\"button\" class=\"layui-btn\" id=\"withExportupdate\" value=\"修改类型\" style=\"height: 49px; margin-top: 18px;margin-left: 206px\">\n" +
                "        </div>";

            $("#tk1").html(element);

            console.log("success")

        });

    })

    layui.use('form',function () {
        var form = layui.form;
        $("#withExportadd").click(function () {
            layer.msg("弹框");
            alert("点击");
            var projectTypeadd = $("#projectTypeadd").val();
            alert(projectTypeadd);
            var url = $("#contextPath").val() + "/projecttypeadd";

            $.ajax({
                type: "post",
                url: url,
                data:JSON.stringify({
                    "projectTypeadd":projectTypeadd
                }),
                dataType: "json",
                async: true,
                contentType: "application/json;charset=utf-8",
                success: function (data) {
                    var element = "<tr>\n" +
                        "                    <td></td>\n" +
                        "                    <td width=\"50px\">序号</td>\n" +
                        "                    <td width=\"80px\">项目类型名称</td>\n" +
                        "                    <td width=\"80px\">创建时间</td>\n" +
                        "                    <td width=\"80px\">修改时间</td>\n" +
                        "                    <td width=\"80px\">操作</td>\n" +
                        "                </tr>";
                    for (var i = 0; i < data.length; i++) {
                        element += "<tr >\n" +
                            "                        <td></td>\n" +
                            "                        <td>"+i+"</td>\n" +
                            "                        <td>"+data[i].prohectTypeName+"</td>\n" +
                            "                        <td>"+data[i].createTime+"</td>\n" +
                            "                        <td>"+data[i].updateTime+"</td>\n" +
                            "                        <td>\n" +
                            "                            <button type=\"button\" class=\"layui-btn\">修改</button>\n" +
                            "                             <a href=\"${pageContext.request.contextPath}/projecttypedelete?projectTypeId="+data[i].projectTypeId+"\"><button type=\"button\" class=\"layui-btn\">删除</button></a>\n" +
                            "                        </td>\n" +
                            "                    </tr>"
                    }

                    $("#table1").html(element);
                    form.render('select');
                },

            });
            console.log("success")

        });


    })



</script>
</html>
